package com.jake.springboot.calculation.strategy.impl;

import com.google.common.base.Preconditions;
import com.jake.springboot.calculation.strategy.CalculationStrategy;
import org.springframework.stereotype.Component;

@Component("divide")
public class DivisionStrategy implements CalculationStrategy {

    @Override
    public int operate(int num1, int num2) {
        Preconditions.checkArgument(num1 != 0, "除数不应为0");
        return num2 / num1;
    }

}
